/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "ContextDataSets.h"

namespace oai::udr::model {

ContextDataSets::ContextDataSets() {
  m_Amf3GppIsSet = false;
  m_AmfNon3GppIsSet = false;
  m_SdmSubscriptionsIsSet = false;
  m_EeSubscriptionsIsSet = false;
  m_Smsf3GppAccessIsSet = false;
  m_SmsfNon3GppAccessIsSet = false;
  m_SubscriptionDataSubscriptionsIsSet = false;
  m_SmfRegistrationsIsSet = false;
  m_IpSmGwIsSet = false;
}

ContextDataSets::~ContextDataSets() {}

void ContextDataSets::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const ContextDataSets &o) {
  j = nlohmann::json();
  if (o.amf3GppIsSet())
    j["amf3Gpp"] = o.m_Amf3Gpp;
  if (o.amfNon3GppIsSet())
    j["amfNon3Gpp"] = o.m_AmfNon3Gpp;
  if (o.sdmSubscriptionsIsSet() || !o.m_SdmSubscriptions.empty())
    j["sdmSubscriptions"] = o.m_SdmSubscriptions;
  if (o.eeSubscriptionsIsSet() || !o.m_EeSubscriptions.empty())
    j["eeSubscriptions"] = o.m_EeSubscriptions;
  if (o.smsf3GppAccessIsSet())
    j["smsf3GppAccess"] = o.m_Smsf3GppAccess;
  if (o.smsfNon3GppAccessIsSet())
    j["smsfNon3GppAccess"] = o.m_SmsfNon3GppAccess;
  if (o.subscriptionDataSubscriptionsIsSet() ||
      !o.m_SubscriptionDataSubscriptions.empty())
    j["subscriptionDataSubscriptions"] = o.m_SubscriptionDataSubscriptions;
  if (o.smfRegistrationsIsSet() || !o.m_SmfRegistrations.empty())
    j["smfRegistrations"] = o.m_SmfRegistrations;
  if (o.ipSmGwIsSet())
    j["ipSmGw"] = o.m_IpSmGw;
}

void from_json(const nlohmann::json &j, ContextDataSets &o) {
  if (j.find("amf3Gpp") != j.end()) {
    j.at("amf3Gpp").get_to(o.m_Amf3Gpp);
    o.m_Amf3GppIsSet = true;
  }
  if (j.find("amfNon3Gpp") != j.end()) {
    j.at("amfNon3Gpp").get_to(o.m_AmfNon3Gpp);
    o.m_AmfNon3GppIsSet = true;
  }
  if (j.find("sdmSubscriptions") != j.end()) {
    j.at("sdmSubscriptions").get_to(o.m_SdmSubscriptions);
    o.m_SdmSubscriptionsIsSet = true;
  }
  if (j.find("eeSubscriptions") != j.end()) {
    j.at("eeSubscriptions").get_to(o.m_EeSubscriptions);
    o.m_EeSubscriptionsIsSet = true;
  }
  if (j.find("smsf3GppAccess") != j.end()) {
    j.at("smsf3GppAccess").get_to(o.m_Smsf3GppAccess);
    o.m_Smsf3GppAccessIsSet = true;
  }
  if (j.find("smsfNon3GppAccess") != j.end()) {
    j.at("smsfNon3GppAccess").get_to(o.m_SmsfNon3GppAccess);
    o.m_SmsfNon3GppAccessIsSet = true;
  }
  if (j.find("subscriptionDataSubscriptions") != j.end()) {
    j.at("subscriptionDataSubscriptions")
        .get_to(o.m_SubscriptionDataSubscriptions);
    o.m_SubscriptionDataSubscriptionsIsSet = true;
  }
  if (j.find("smfRegistrations") != j.end()) {
    j.at("smfRegistrations").get_to(o.m_SmfRegistrations);
    o.m_SmfRegistrationsIsSet = true;
  }
  if (j.find("ipSmGw") != j.end()) {
    j.at("ipSmGw").get_to(o.m_IpSmGw);
    o.m_IpSmGwIsSet = true;
  }
}

Amf3GppAccessRegistration ContextDataSets::getAmf3Gpp() const {
  return m_Amf3Gpp;
}
void ContextDataSets::setAmf3Gpp(Amf3GppAccessRegistration const &value) {
  m_Amf3Gpp = value;
  m_Amf3GppIsSet = true;
}
bool ContextDataSets::amf3GppIsSet() const { return m_Amf3GppIsSet; }
void ContextDataSets::unsetAmf3Gpp() { m_Amf3GppIsSet = false; }
AmfNon3GppAccessRegistration ContextDataSets::getAmfNon3Gpp() const {
  return m_AmfNon3Gpp;
}
void ContextDataSets::setAmfNon3Gpp(AmfNon3GppAccessRegistration const &value) {
  m_AmfNon3Gpp = value;
  m_AmfNon3GppIsSet = true;
}
bool ContextDataSets::amfNon3GppIsSet() const { return m_AmfNon3GppIsSet; }
void ContextDataSets::unsetAmfNon3Gpp() { m_AmfNon3GppIsSet = false; }
std::vector<SdmSubscription> &ContextDataSets::getSdmSubscriptions() {
  return m_SdmSubscriptions;
}
void ContextDataSets::setSdmSubscriptions(
    std::vector<SdmSubscription> const &value) {
  m_SdmSubscriptions = value;
  m_SdmSubscriptionsIsSet = true;
}
bool ContextDataSets::sdmSubscriptionsIsSet() const {
  return m_SdmSubscriptionsIsSet;
}
void ContextDataSets::unsetSdmSubscriptions() {
  m_SdmSubscriptionsIsSet = false;
}
std::vector<EeSubscription> &ContextDataSets::getEeSubscriptions() {
  return m_EeSubscriptions;
}
void ContextDataSets::setEeSubscriptions(
    std::vector<EeSubscription> const &value) {
  m_EeSubscriptions = value;
  m_EeSubscriptionsIsSet = true;
}
bool ContextDataSets::eeSubscriptionsIsSet() const {
  return m_EeSubscriptionsIsSet;
}
void ContextDataSets::unsetEeSubscriptions() { m_EeSubscriptionsIsSet = false; }
SmsfRegistration ContextDataSets::getSmsf3GppAccess() const {
  return m_Smsf3GppAccess;
}
void ContextDataSets::setSmsf3GppAccess(SmsfRegistration const &value) {
  m_Smsf3GppAccess = value;
  m_Smsf3GppAccessIsSet = true;
}
bool ContextDataSets::smsf3GppAccessIsSet() const {
  return m_Smsf3GppAccessIsSet;
}
void ContextDataSets::unsetSmsf3GppAccess() { m_Smsf3GppAccessIsSet = false; }
SmsfRegistration ContextDataSets::getSmsfNon3GppAccess() const {
  return m_SmsfNon3GppAccess;
}
void ContextDataSets::setSmsfNon3GppAccess(SmsfRegistration const &value) {
  m_SmsfNon3GppAccess = value;
  m_SmsfNon3GppAccessIsSet = true;
}
bool ContextDataSets::smsfNon3GppAccessIsSet() const {
  return m_SmsfNon3GppAccessIsSet;
}
void ContextDataSets::unsetSmsfNon3GppAccess() {
  m_SmsfNon3GppAccessIsSet = false;
}
std::vector<SubscriptionDataSubscriptions> &
ContextDataSets::getSubscriptionDataSubscriptions() {
  return m_SubscriptionDataSubscriptions;
}
void ContextDataSets::setSubscriptionDataSubscriptions(
    std::vector<SubscriptionDataSubscriptions> const &value) {
  m_SubscriptionDataSubscriptions = value;
  m_SubscriptionDataSubscriptionsIsSet = true;
}
bool ContextDataSets::subscriptionDataSubscriptionsIsSet() const {
  return m_SubscriptionDataSubscriptionsIsSet;
}
void ContextDataSets::unsetSubscriptionDataSubscriptions() {
  m_SubscriptionDataSubscriptionsIsSet = false;
}
std::vector<SmfRegistration> &ContextDataSets::getSmfRegistrations() {
  return m_SmfRegistrations;
}
void ContextDataSets::setSmfRegistrations(
    std::vector<SmfRegistration> const &value) {
  m_SmfRegistrations = value;
  m_SmfRegistrationsIsSet = true;
}
bool ContextDataSets::smfRegistrationsIsSet() const {
  return m_SmfRegistrationsIsSet;
}
void ContextDataSets::unsetSmfRegistrations() {
  m_SmfRegistrationsIsSet = false;
}
IpSmGwRegistration ContextDataSets::getIpSmGw() const { return m_IpSmGw; }
void ContextDataSets::setIpSmGw(IpSmGwRegistration const &value) {
  m_IpSmGw = value;
  m_IpSmGwIsSet = true;
}
bool ContextDataSets::ipSmGwIsSet() const { return m_IpSmGwIsSet; }
void ContextDataSets::unsetIpSmGw() { m_IpSmGwIsSet = false; }

} // namespace oai::udr::model
